import Vue from 'vue'
import VueRouter from 'vue-router'
import LayoutView from '../views/LayoutView.vue'
import UserManage from '../views/UserManage.vue'
import Login from '../views/LoginView.vue'
// component: () => import(/* webpackChunkName: "about" */ '../views/LayoutView.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: LayoutView,
    children: [
      {
        path: 'user_manage',
        component: UserManage,
        name: 'user_manage'
      },
      {
        path: 'movie_manage',
        name: 'movie_manage',
        component: () => import(/* webpackChunkName: "movie_manage" */ '../views/MovieManage.vue')
      }
    ]
  },
  {
    path: '/login',
    component: Login,
    name: 'login'
  }
]

const router = new VueRouter({
  routes
})

export default router
